<table class="layui-table" style="width:3500px;" id="contentTab">
 	<input type="hidden" id="billid" th:value="${purchaseOrder.id}"/>
 	<input type="hidden" id="billno" th:value="${purchaseOrder.orderNo}"/>
 	<input type="hidden" id="companyid" th:value="${purchaseOrder.companyid}"/>
 	<input type="hidden" id="companyid" th:value="${purchaseOrder.orderNo}"/>
 	<input type="hidden" id="supplierid" th:value="${purchaseOrder.supplierid}"/>
  <thead>
    <tr>
    	 <th><input type="checkBox" lay-skin="primary" name="headCheckBox" lay-filter="headCheckBox"/></th>
      	 <th data-field="sourceOrderNo">来源单号</th>
		 <th data-field="materiaCode">物料编码</th>
		 <th data-field="materiaName">物料名称</th>
		 <th data-field="materiaSpec">物料规格</th>
		 <th data-field="materiaType">物料类型</th>
		 <th data-field="brand">品牌</th>
		 <th data-field="measurementUnit">计量单位</th>
		 <th data-field="wharehouse">预入仓库</th>
		 <th data-field="supplierMateriaCode">供应商物料编码</th>
		 <th data-field="supplierMateriaName">供应商物料名称</th>
		 <th data-field="supplierMateriaSpec">供应商物料规格</th>
		 <th data-field="settlementType">结算方式</th>
		 <th data-field="settlementDay">结算天数</th>
		 <th data-field="settlementCurrency">结算币种</th>
		 <th data-field="settlementExchangeRate">汇率</th>
		 <th data-field="taxRate">税率</th>
		 <th data-field="num">采购数量</th>
		 <th data-field="price">单价</th>
		 <th data-field="taxPrice">含税单价</th>
		 <th data-field="excludingTaxPriceTotal">未含税费用</th>
		 <th data-field="tax">税额</th>
		 <th data-field="totalPrice">含税费用</th>
		 <th data-field="requireDate">需求日期</th>
		 <th data-field="instorageCount">订单入库量</th>
		 <th data-field="notInstorageCount">订单未入库量</th>
		 <th data-field="onHandNum">现存量</th>
		 <th data-field="availableNum">可用量</th>
    </tr>
     </thead>
    <tbody>
   
    <tr th:each="item : ${details}" class="edittr" >
    	<td style="width:40px;"><input type="checkBox" lay-skin="primary" name="trCheckBox"/></td>
		<td style="width:150px;"><input type="hidden" name="id" th:value="${item.id}"/><span th:text="${item.sourceOrderNo}"></span></td>
		<td style="width:150px;padding-left:0px;padding-right:0px;">
			<input type="text" name="materialCode" class="layui-input" style="width:150px;" th:value="${item.materiaCode}"/>
			<input type="hidden" name="materialId" class="layui-input" style="width:150px;" th:value="${item.materiaId}"/>
		</td>
		<td name='name' style="background-color:#f3f2f2;width:200px;" th:text="${item.materiaName}"></td>
		<td name='spec' style="background-color:#f3f2f2" th:text="${item.materiaSpec}"></td>
		<td name="type" style="background-color:#f3f2f2" th:text="${item.materiaType}"></td>
		<td name="brand" style="background-color:#f3f2f2" th:text="${item.brand}"></td>
		<td name="measureUnit" style="background-color:#f3f2f2" th:text="${item.measurementUnit}"></td>
		<td name="wharehouse" style="background-color:#f3f2f2;width:160px;">
			<select lay-filter="wharehouse" name="wharehouseId">
				<option value="">请选择仓库</option>	
				<option th:each="s :${stores}" th:value="${s.code}" th:text="${s.value}" th:selected="${item.inStorage==s.code}"></option>
			</select>
		</td>
		<td name="sup_code" style="background-color:#f3f2f2" th:text="${item.supplierMateriaCode}"></td>
		<td name="sup_name" style="background-color:#f3f2f2" th:text="${item.supplierMateriaName}"></td>
		<td name="sup_spec" style="background-color:#f3f2f2" th:text="${item.supplierMateriaSpec}"></td>
		<td style="background-color:#f3f2f2;padding-left:0px;padding-right:0px;width:120px;text-align:center;">
			<span th:text="${item.settlementType}"></span>

		</td>
		<td style="background-color:#f3f2f2" name="settlementDay"><span th:text="${item.settlementDay}"></span></td>
		<td style="background-color:#f3f2f2" name="settlementCurrency"><span th:text="${item.settlementCurrency}"></span></td>
		<td style="background-color:#f3f2f2" name="settlementExchangeRate"><span th:text="${item.exchargeRate}"></span></td>
		<td style="background-color:#f3f2f2" name="taxRate"><span th:text="${item.taxRate}"></span>%</td>
		<td style="padding-left:0px;padding-right:0px;width:120px;"><input style="width:120px;" type="text" name="num" required  lay-verify="required|number" placeholder="采购数量" autocomplete="off" class="layui-input" th:value="${item.num}"/></td>
		<td style="padding-left:0px;padding-right:0px;width:80px;"><input style="width:80px;" type="text" name="price" required  lay-verify="required|number" placeholder="单价" autocomplete="off" class="layui-input" th:value="${item.price}"/></td>
		<td name="taxPrice" style="background-color:#f3f2f2"><span th:text="${item.inclusivePrice}"></span></td>
		<td name='excludingTaxPriceTotal' style="background-color:#f3f2f2"><span th:text="${item.taxExcludedTotal}"></span></td>
		<td name="tax" style="background-color:#f3f2f2"><span th:text="${item.tax}"></span></td>
		<td name="totalPrice" style="background-color:#f3f2f2"><span th:text="${item.inclusiveTotal}"></span></td>
		<td><span th:text="${#dates.format(item.requireDate, 'yyyy-MM-dd HH:mm:ss')}"></span></td>
		<td><span th:text="${item.instorageCount}"></span></td>
		<td><span th:text="${item.notInstorageCount}"></span></td>
		<td name="onHandNum" th:text="${item.standingCropCount}"></td>
		<td name="availableNum" th:text="${item.avliabelCount}"></td>
	</tr>
	</tbody>
</table>
<table style="display:none;" id="blankTpl">
<tbody>
<tr class="edittr">
		<td style="width:40px;"><input type="checkBox" lay-skin="primary" name="trCheckBox" lay-filter="trCheckBox"/></td>
		<td style="width:50px"><input type="hidden" name="id" value=""/><span th:text="${purchaseOrder.sourceOrderNo}"></span></td>
		<td style="width:150px;padding-left:0px;padding-right:0px;">
			<input type="text" name="materialCode" class="layui-input" style="width:150px;" value=""/>
			<input type="hidden" name="materialId" class="layui-input" style="width:150px;" value=""/>
		</td>
		<td name='name' style="background-color:#f3f2f2;width:200px;"><span></span></td>
		<td name='spec' style="background-color:#f3f2f2"></td>
		<td name="type" style="background-color:#f3f2f2"></td>
		<td name="brand" style="background-color:#f3f2f2"></td>
		<td name="measureUnit" style="background-color:#f3f2f2"></td>
		<td name="wharehouse" style="background-color:#f3f2f2;width:160px;">
			<select lay-filter="wharehouse" name="wharehouseId">
				<option value="">请选择仓库</option>	
				<option th:each="s:${stores}" th:value="${s.code}" th:text="${s.value}"></option>
			</select>
		</td>
		<td name="sup_code" style="background-color:#f3f2f2"></td>
		<td name="sup_name" style="background-color:#f3f2f2"></td>
		<td name="sup_spec" style="background-color:#f3f2f2"></td>
		<td style="background-color:#f3f2f2;padding-left:0px;padding-right:0px;width:120px;text-align:center;">
			<span th:text="${purchaseOrder.settleMethodName}"></span>
		</td>
		<td style="background-color:#f3f2f2" name="settlementDay"><span th:text="${purchaseOrder.settleDays}"></span></td>
		<td style="background-color:#f3f2f2" name="settlementCurrency"><span th:text="${purchaseOrder.settleCurrencyName}"></span></td>
		<td style="background-color:#f3f2f2" name="settlementExchangeRate"><span th:text="${purchaseOrder.exchargeRate}"></span></td>
		<td style="background-color:#f3f2f2" name="taxRate"><span th:text="${purchaseOrder.taxRate}"></span>%</td>
		<td style="padding-left:0px;padding-right:0px;width:120px;"><input style="width:120px;" type="text" name="num" required  lay-verify="required|number" placeholder="采购数量" autocomplete="off" class="layui-input"></td>
		<td style="padding-left:0px;padding-right:0px;width:80px;"><input style="width:80px;" type="text" name="price" required  lay-verify="required|number" placeholder="单价" autocomplete="off" class="layui-input"></td>
		<td name="taxPrice" style="background-color:#f3f2f2"><span></span></td>
		<td name='excludingTaxPriceTotal' style="background-color:#f3f2f2"><span></span></td>
		<td name="tax" style="background-color:#f3f2f2"><span></span></td>
		<td name="totalPrice" style="background-color:#f3f2f2"><span></span></td>
		<td></td>
		<td></td>
		<td></td>
		<td name="onHandNum"></td>
		<td name="availableNum"></td>
	</tr>
	</tbody>
</table>